package xyz.jcat.seata.example.points.service;

import io.seata.rm.tcc.api.BusinessActionContext;
import io.seata.rm.tcc.api.BusinessActionContextParameter;
import io.seata.rm.tcc.api.LocalTCC;
import io.seata.rm.tcc.api.TwoPhaseBusinessAction;
import xyz.jcat.mybatis.IService;
import xyz.jcat.seata.example.api.dto.PointsIncrDto;
import xyz.jcat.seata.example.points.domain.po.UserPointsPo;

/**
 *
 * @author yueyue
 * auto on 2022-03-16 00:51:35
 */
@LocalTCC
public interface IUserPointsService extends IService<UserPointsPo> {

    @TwoPhaseBusinessAction(name = "incrUserPoints",
        commitMethod = "incrUserPointsCommitMethod",
        rollbackMethod = "incrUserPointsRollbackMethod"
    )
    void incr(@BusinessActionContextParameter(paramName = "pointsIncrDto") PointsIncrDto pointsIncrDto);

    boolean incrUserPointsCommitMethod(BusinessActionContext context);

    boolean incrUserPointsRollbackMethod(BusinessActionContext context);

}
